package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.domain.SuccessCode;
import com.atguigu.jxc.service.GoodsService;
import com.google.gson.JsonArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @description 系统首页请求控制器
 */
@Controller
public class IndexController {

//    @Autowired
//    private GoodsService goodsService;
//
//    @PostMapping("goods/listInventory")
//    public ServiceVO<Map<String, Object>> queryGoodsInventoryById(
//            @RequestParam("codeOrName") String codeOrName,
//            @RequestParam("goodsTypeId") Integer goodsTypeId
//    ){
//
//        try {
//            this.goodsService.wait();
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//
//        return new ServiceVO<>(SuccessCode.SUCCESS_CODE,SuccessCode.SUCCESS_MESS);
//    }


    /**
     * 进入登录页面
     * @return 重定向至登录页面
     */
    @GetMapping("/")
    public String toIndex(){
        return "redirect:login.html";
    }
}
